public class Test  {
    public static void main(String[] args) {
        GeometricObject geoObject1 = new Circle(5);
        GeometricObject geoObject2 = new Rectangle(5, 3);
        GeometricObject Side_length=new Hexagon(6) {
        };

        GeometricObject max=equalArea(Side_length,geoObject1);

        GeometricObject min=equalCircumference(geoObject1, Side_length);
        // Display circle
        displayGeometricObject(max);
        displayGeometricObject(min);

        // Display rectangle


    }
    public static  GeometricObject  equalArea (GeometricObject  Side_length, GeometricObject geoObject1) {
        if(Side_length.getArea()>geoObject1.getArea()){
            return Side_length;
        }else{
            return geoObject1;
        }

    }
    public static  GeometricObject  equalCircumference(GeometricObject  Side_length,GeometricObject  Side_length1){
        if(Side_length.getPerimeter()<Side_length1.getPerimeter()){
            return Side_length;
        }else{
            return Side_length1;
        }
    }
    public static void displayGeometricObject(GeometricObject Side_length) {
        System.out.println();
        System.out.println("The  area is " + Side_length.getArea());
        System.out.println("The  perimeter is " + Side_length.getPerimeter());
    }


}
